package com.java.shop.service.impl;

import com.java.shop.bean.User;
import com.java.shop.dao.UserMapper;
import com.java.shop.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service("userService")
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;

    @Override
    public int deleteByPrimaryKey(Integer ID) {
        return 0;
    }

    @Override
    public int insert(User user) {
        return 0;
    }

    @Override
    public int insertSelective(User user) {
        return userMapper.insertSelective(user);
    }

    @Override
    public User selectByPrimaryKey(Integer ID) {
        System.out.println(userMapper);
        User user = userMapper.selectByPrimaryKey(ID);
        return user;
    }

    @Override
    public int updateByPrimaryKeySelective(User user) {
        return 0;
    }

    @Override
    public int updateByPrimaryKey(User user) {
        return 0;
    }

    @Override
    public User userLogin(String userName, String password) {
        User user = userMapper.userLogin(userName,password);
        return  user;
    }

    @Override
    public User selectUserByMobile(String mobile) {
        return userMapper.selectUserByMobile(mobile);
    }

    @Override
    public User selectUserByUserName(String userName) {
        return userMapper.selectUserByUserName(userName);
    }


}
